package rrrmai.viewbinder;

import android.databinding.DataBindingUtil;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.xgggh.rrrmai.R;
import com.xgggh.rrrmai.databinding.ItemCommentBinding;
import me.drakeet.multitype.ItemViewBinder;

/**
 * Created by summer on 2018/2/28.
 */
public class CommentViewBinder extends ItemViewBinder<Comment, CommentViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
       ItemCommentBinding binding= DataBindingUtil.inflate(inflater,R.layout.item_comment,parent,false);
        return new ViewHolder(binding.getRoot());
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull Comment comment) {
        ItemCommentBinding binding= DataBindingUtil.getBinding(holder.itemView);
        comment.setHint("填写客观的评价哦");
       // binding.setComment(comment);
    }



    static class ViewHolder extends RecyclerView.ViewHolder {

        ViewHolder(View itemView) {
            super(itemView);
        }
    }
}
